import Taro, { Component } from '@tarojs/taro'
import { Provider } from '@tarojs/redux'
import Home from './pages/home/index'
import configStore from './store'
import './app.scss'

const store = configStore()

class App extends Component {

  config = {
    pages: [
      'pages/home/index',
      'pages/goods/index',
      'pages/confirm/index',
      'pages/cart/index',
      'pages/user/index',
      'pages/mixed/index'
    ],
    window: {
      backgroundTextStyle: 'light',
      navigationBarBackgroundColor: '#fff',
      navigationBarTitleText: 'WeChat',
      navigationBarTextStyle: 'black'
    },
    tabBar: {
      color: '#666666',
      selectedColor: '#BA241B',
      backgroundColor: '#FFFFFF',
      list: [{
        pagePath: 'pages/home/index',
        text: '首页',
        iconPath: './assets/tabbar/home.png',
        selectedIconPath: './assets/tabbar/home-active.png'
      }, {
        pagePath: 'pages/cart/index',
        text: '购物车',
        iconPath: './assets/tabbar/cart.png',
        selectedIconPath: './assets/tabbar/cart-active.png'
      }, {
        pagePath: 'pages/user/index',
        text: '我的',
        iconPath: './assets/tabbar/user.png',
        selectedIconPath: './assets/tabbar/user-active.png'
      }]
    }
  }

  componentDidMount () { }

  componentDidShow () { }

  componentDidHide () { }

  componentDidCatchError () { }

  // 在 App 类中的 render() 函数没有实际作用
  // 请勿修改此函数
  render () {
    return (
      <Provider store={store}>
        <Home />
      </Provider>
    )
  }
}

Taro.render(<App />, document.getElementById('app'))
